﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DeployGames.TweenEngine.TestBed.wpf.acessor;

namespace DeployGames.TweenEngine.TestBed.wpf
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private TweenManager tweenManager;
        public MainWindow()
        {
            InitializeComponent();
            tweenManager = new TweenManager();
            Tween.registerAccessor(typeof(AcessorButton), new ButtonAcessor());
        }

        public void Update(double delta, double time)
        {
            tweenManager.update((float)delta);
        }

        private void button50_Click(object sender, RoutedEventArgs e)
        {
            Button bt = (sender as Button);
            String tag = bt.Tag.ToString();
            Canvas.SetLeft(acessorButton, 20);
            Tween.to(acessorButton, ButtonAcessor.X, 1.5f)
                .ease(TweenEquations.getEase(tag))
                .targetRelative(448f)
                .start(tweenManager);
        }
    }
}
